﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="frmEvent.ascx.cs" Inherits="GUESTSMANAGEMENT.View.Event.frmEvent" %>
<%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>

<ext:ScriptManagerProxy ID="ScriptManagerProxy" runat="server">
</ext:ScriptManagerProxy>

<script type="text/javascript">
    var openWindowEvent = function() {
    var winEvent = <%= winEvent.ClientID %>;
        winEvent.show();
    }
</script>

<ext:Window ID="winEvent" runat="server" Collapsible="false" Icon="World" Title="Cadastro de Eventos" ShowOnLoad="false" Width="530" Height="250" Resizable="false">
    <TopBar>
        <ext:Toolbar ID="ToolBar1" runat="server">
            <Items>
                <ext:ToolbarButton ID="btnSave" Icon="Disk" runat="server">
                    <ToolTips>
                        <ext:ToolTip ID="ToolTip" runat="server" Title="Salvar Evento">
                        </ext:ToolTip>
                    </ToolTips>
                    <AjaxEvents>
                        <Click OnEvent="FormSave" Before="var valid= #{StatusForm}.getForm().isValid(); if(valid){#{FormStatusBar}.showBusy('Aguarde...');} return valid;">
                            <EventMask ShowMask="true" MinDelay="1000" Target="CustomTarget" CustomTarget="={#{StatusForm}.getEl()}" />
                        </Click>
                    </AjaxEvents>
                </ext:ToolbarButton>
                <ext:ToolbarSeparator ID="ToolbarSeparator" runat="server">
                </ext:ToolbarSeparator>
                <ext:ToolbarButton ID="btnClose" runat="server" Icon="DoorIn">
                    <Listeners>
                        <Click Handler="#{winEvent}.hide(null);" />
                    </Listeners>
                    <AjaxEvents>
                        <Click OnEvent="Close"></Click>
                    </AjaxEvents>
                    <ToolTips>
                        <ext:ToolTip ID="CloseNewEvent" runat="server" Title="Sair"></ext:ToolTip>
                    </ToolTips>
                </ext:ToolbarButton>
            </Items>
        </ext:Toolbar>
    </TopBar>
    <Body>
        <ext:Hidden ID="txt_eventId" runat="server"></ext:Hidden>
            <ext:FitLayout ID="FitLayout" runat="server">
                <ext:FormPanel ID="StatusForm" runat="server"
                LabelWidth="75"
                Width="400"
                ButtonAlign="Right"
                Border="false"
                BodyStyle="padding:10px 10px 0;">
                <Defaults>
                    <ext:Parameter Name="Anchor" Value="95%" />
                    <ext:Parameter Name="AllowBlank" Value="true" Mode="Raw" />
                    <ext:Parameter Name="SelectOnFocus" Value="true" Mode="Raw" />
                    <ext:Parameter Name="MsgTarget" Value="side" />
                    <ext:Parameter Name="LabelSeparator" Value="" />
                </Defaults>
                <Body>
                    <ext:FormLayout ID="FormLayout" runat="server">
                        <ext:Anchor>
                            <ext:MultiField runat="server" FieldLabel="Evento">
                                <Fields>
                                    <ext:TextField ID="eventName" runat="server" AllowBlank="false" Width="180" MaxLength="255" BlankText="Nome é requerido!" />
                                    <ext:DateField ID="eventDate" runat="server" AllowBlank="false" Width="115" BlankText="Data é requerido!" />
                                    <ext:TimeField ID="eventTime" TypeAhead="true" runat="server" AllowBlank="false" MinTime="00:00"   Width="100" MaxTime="23:59" BlankText="Horário para expirar a lista é obrigatório!" Increment="30" Format="H:mm"/>
                                </Fields>
                            </ext:MultiField>
                        </ext:Anchor>

                        <ext:Anchor>
                            <ext:TextArea ID="eventDescription" GrowMax="4000" GrowMin="0" AllowBlank="true" Width="550" Height="40" runat="server" MaxLength="4000" FieldLabel="Descrição" BlankText="Descrição é requerido!" >
                            </ext:TextArea>
                        </ext:Anchor>  
                        <ext:Anchor>
                            <ext:MultiField ID="MultiField1" runat="server" FieldLabel="Qt. Convites">
                                <Fields>
                                    <ext:NumberField runat="server" MaxValue="100" ID="Nqtbf" Width="98" Note="Bônus Fem." AllowBlank="false"></ext:NumberField>
                                    <ext:NumberField runat="server" MaxValue="100" ID="Nqtbm" Width="99" Note="Bônus Masc." AllowBlank="false"></ext:NumberField>
                                    <ext:NumberField runat="server" MaxValue="100" ID="Nqtff" Width="98" Note="Free Fem." AllowBlank="false"></ext:NumberField>
                                    <ext:NumberField runat="server" MaxValue="100" ID="Nqtfm" Width="99" Note="Free Masc." AllowBlank="false"></ext:NumberField>
                                </Fields>
                            </ext:MultiField>  
                       </ext:Anchor>   
                    </ext:FormLayout>
                </Body>
            </ext:FormPanel>
        </ext:FitLayout>
    </Body>
    <BottomBar>
        <ext:StatusBar ID="FormStatusBar" runat="server" DefaultText="Ready">
            <Plugins>
                <ext:ValidationStatus ID="ValidationStatus1" runat="server" FormPanelID="StatusForm" ValidIcon="Accept" ErrorIcon="Exclamation" />
            </Plugins>
        </ext:StatusBar>
    </BottomBar>
</ext:Window>
